//
//  AudioPlayerExampleViewController.m
//  AudioPlayerExample
//

#import "AudioPlayerExampleViewController.h"

@implementation AudioPlayerExampleViewController

- (void)viewDidLoad {
    [super viewDidLoad];
	
	NSString *filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"song.mp3"];
	NSURL *fileURL = [NSURL fileURLWithPath:filePath];
	NSError *error = nil;
	audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:&error];
	if (error)
		NSLog(@"Error: %@", error);
	else
		audioPlayer.play;
}

- (void)dealloc {
	[audioPlayer release];
    [super dealloc];
}

@end
